﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.BLL;

public partial class UserControl_BBQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //GetContent("");
        }
    }


    private void GetContent(string Title)
    {
        KCAdvanceQuery bbquery = new KCAdvanceQuery();
        string strfileID = this.fileID.Text;
        string strtitleName = Request.Form["titleName"];
        string strBBCode = Request.Form["BBCode"];
        string strBBName = Request.Form["BBName"];
        string strsamLoction = Request.Form["samLoction"];
        string strsamMethod = Request.Form["samMethod"];
        string stroutName = Request.Form["outName"];
        string strinName = Request.Form["inName"];
      
        //string MineName = Request.QueryString["values"];

        DataSet ds = bbquery.BBAdvancedQuery(strfileID, strtitleName, strBBCode, strBBName, strsamLoction, strsamMethod, stroutName, strinName);


        DataTable dt = ds.Tables[0];
        DataView dv = dt.DefaultView;
        //对用于分页的类的引用
        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = dt.DefaultView;//设置数据源(DataTable类型)
        pds.AllowPaging = true;


        AspNetPager1.RecordCount = dv.Count;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize = AspNetPager1.PageSize;
        dl_FileList.DataSource = pds;
        dl_FileList.DataBind();

  }




    protected void SearchBtn_Click(object sender, ImageClickEventArgs e)
    {
        GetContent("");

        //KCAdvanceQuery bbquery = new KCAdvanceQuery();
        //dl_FileList.DataSource = bbquery.BBAdvancedQuery(null, null, null, null, null, null,null,null);
        //dl_FileList.DataBind();
        FileList.Attributes["style"] = "display:''";

    }


    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        GetContent("");
    }

}
